package com.ld.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> implements Serializable {
    private long total;         //总记录数
    private List<T> rows;       //每页结果
    private long totalPage;     //总页数
    private int page;           //当前页

    public PageResult(long total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }

    public PageResult(long total, List<T> rows, long totalPage) {
        this.total = total;
        this.rows = rows;
        this.totalPage = totalPage;
    }
}
